package main;

import algo.couterbased.Frequent;
import algo.couterbased.LossyCounting;
import algo.couterbased.SpaceSaving;
import algo.sketch.CountMin;
import algo.sketch.CountSketch;
import algorithm.AbstractCounterBased;
import algorithm.AbstractSketch;
import data.Data;
import data.StaticData;

public class RunAll {

	public static void main(String[] args) {
//		Data data = StaticData.DATA100k_50k;
		Data data = StaticData.DATA100k_100k;
		int[] stream = data.getItems();
		int maxScale = data.getMaxScale();

		AbstractCounterBased frequent = new Frequent();
		AbstractCounterBased lossy = new LossyCounting();
		AbstractCounterBased space = new SpaceSaving();

		double eps = 0.001;
		double confidence = 0.99;

		AbstractSketch countsSketch = new CountSketch();
		AbstractSketch countMin = new CountMin();

		for (int i = 0; i < 5; i++){
			System.out.println("Iteration " + i);
			frequent.run(stream, maxScale);
			space.run(stream, maxScale);
			lossy.run(stream, maxScale);

			countsSketch.run(eps, confidence, data);
			countMin.run(eps, confidence, data);
		}
	}

}
